#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QSerialPort>
#include <QSerialPortInfo>
#include <QMessageBox>
#include <QtCharts>
#include <QRandomGenerator>
#include <cstring>
#include <QCryptographicHash>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void readSerialData();
    void readSerialByte();

    void on_pushButton_connect_clicked();

    void on_pushButton_disconnect_clicked();

    void on_pushButton_refresh_clicked();

    void on_pushButton_send_clicked();

    void on_pushButton_gen_clicked();

    void on_pushButton_start_clicked();

private:
    Ui::MainWindow *ui;
    QSerialPort *serialPort;
    QTimer *timer;
    int receiveInterval;
    QByteArray testData, hashcode;
    bool connected;
};
#endif // MAINWINDOW_H
